/**
 * 
 */
package lexicon;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Jamada
 *
 */
public class LoadLexiconHashMap {

	private LoadLexiconHashMap() {
		//prevent instantiation
	}
	
    @SuppressWarnings("unchecked")
    public static Map<String, int[]> loadLexiconHashMap() {
        Map<String, int[]> lexiconMap = null;
        try {
            FileInputStream fis = new FileInputStream("LexiconHashMap.ser");
            ObjectInputStream ois = new ObjectInputStream(fis);
            lexiconMap = (HashMap<String, int[]>) ois.readObject();
            ois.close();
            fis.close();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        } catch (ClassNotFoundException c) {
            System.out.println("Class not found");
            c.printStackTrace();
        }
        System.out.println("Deserialized HashMap..");
        return lexiconMap;
    }
}
